feat(MK8S-196): expose shared QueryClient to MCP tools via ToolContext#4925
feat(MK8S-196): expose shared QueryClient to MCP tools via ToolContext#4925JBWatenbergScality wants to merge 1 commit into
Conversation
Hello jbwatenbergscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
|
/approve |
| get getToken() { return getTokenRef.current; }, | ||
| get userData() { return userDataRef.current; }, | ||
| selfConfiguration, | ||
| queryClient: shellQueryClient, |
There was a problem hiding this comment.
nit: instead of importing shellQueryClient from ../FederatedApp, _InternalMCPRegistrar can likely useQueryClient to retireve it.
Add `queryClient: QueryClient` to `ToolContext` so federated apps' MCP tools can keep chat-side panels in sync after mutations. The QueryClient is retrieved via react-query's `useQueryClient` hook, which works because `MCPRegistrar` is rendered inside the shell-ui `QueryClientProvider`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c50a36f to
e297d82
Compare
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option The following options are set: approve |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: The following options are set: approve |
|
LGTM — clean, minimal change. The |
|
/approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
Queue build failedThe corresponding build for the queue failed:
Remove the pull request from the queue
|
Summary
queryClient: QueryClienttoToolContextso federated apps' MCP tools can keep chat-side panels in sync after mutations.MCPRegistrarfrom the shell-ui-ownedqueryClientexported byFederatedApp.tsx.Follow-up to merged PR #4820 (branch was kept alive). Pairs with:
Why
The previous wrapper-side approach (zenko-ui's
withQueryCacheInvalidation) calledinvalidateQueries()with no arguments after every non-readonly tool, blowing the entire cache — including auth queries — and leaving the UI empty. Injecting the QueryClient lets each tool target only the keys it actually affects.Test plan
🤖 Generated with Claude Code